package org.example.shop.storage.service.impl;

import org.example.shop.entity.Storage;
import org.example.shop.storage.dao.StorageDao;
import org.example.shop.storage.service.StorageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StorageServiceImpl implements StorageService {

    @Resource
    private StorageDao storageDao;

    public Storage findBySid(Integer sid) {
        return storageDao.findById(sid).get();
    }

    @Override
    public Storage save(Storage storage) {
        return storageDao.saveAndFlush(storage);
    }
}
